import * as React from 'react';
import { BrowserRouter, Switch, Route, Redirect } from 'react-router-dom';
import { ConfigProvider } from 'antd'
import Home from '../Home';
import Index from '../Index';
import zhCN from 'antd/lib/locale/zh_CN'

//路由配置
export default class App extends React.Component {
  render() {//首页、购物页
    return (
      <ConfigProvider locale={zhCN}>
          <BrowserRouter>
              <Switch>
                  <Route path="/home" exact component={Home} />
                  <Route path="/index" component={Index} />
                  <Redirect from="/" to="/index" exact />
              </Switch>
          </BrowserRouter>
      </ConfigProvider>
    );
  }
}